﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XSTDZ.ERP.Core.Extentions;
namespace XSTDZ.ERP.Domain.Models
{
    /// <summary>
    /// 用户权限
    /// </summary>
    public partial class UserPermission
    {
        /*
        internal UserPermission AddRole(Role role)
        {
            if (!this.Roles.Contains(role))
            {
                this.Roles.Add(role);
            }
            return this;
        }
        
        internal UserPermission AddRoles(IEnumerable<Role> roles)
        {

            roles.Each(role => this.AddRole(role));
            return this;
        }

        internal UserPermission ResetRoles(IEnumerable<Role> roles)
        {
            this.Roles.Clear();
            if (roles == null || roles.Count() == 0) return this;
            this.AddRoles(roles);
            return this;
        }

 

        internal UserPermission AddPermission(Permission permission)
        {
            if (!this.Permissions.Contains(permission))
            {
                this.Permissions.Add(permission);
            }
            return this;
        }

        internal UserPermission AddPermissions(IEnumerable<Permission> permissions)
        {

            permissions.Each(permission => this.AddPermission(permission));
            return this;
        }

        internal UserPermission ResetPermissions(IEnumerable<Permission> permissions)
        {
            this.Permissions.Clear();
            if (permissions == null || permissions.Count() == 0) return this;
            this.AddPermissions(permissions);
            return this;
        }
        */

    }
}
